using System;
using System.Collections.Generic;
using System.Text;

namespace Colman.Rpg.Messaging
{
    /// <summary>
    /// The response received when a player has won a battle.
    /// </summary>
    [Serializable]
    public class PlayerWinsResponse : ResponseMessage
    {
        /// <summary>
        /// Creates a new instance of <see cref="PlayerWinsResponse" />.
        /// </summary>
        /// <param name="player">Represents the player's situation after the win.</param>
        /// <param name="gainedXP">Represents the amount of XP gained by winning.</param>
        /// <param name="goldWon">Represents the amount of gold gained by winning.</param>
        [System.Diagnostics.DebuggerStepThrough]
        public PlayerWinsResponse(Player player, int gainedXP, int goldWon)
            : base(ResponseDestination.Requester)
        {
            this.player = player;
            this.gainedXP = gainedXP;
            this.goldWon = goldWon;
        }

        /// <summary>
        /// Creates a new instance of <see cref="PlayerWinsResponse" />.
        /// </summary>
        /// <param name="player">Represents the player's situation after the win.</param>
        /// <param name="gainedXP">Represents the amount of XP gained by winning.</param>
        /// <param name="destinations">The destinations of the message.</param>
        [System.Diagnostics.DebuggerStepThrough]
        public PlayerWinsResponse(Player player, int gainedXP, params Player[] destinations)
            : base(destinations)
        {
            this.player = player;
            this.gainedXP = gainedXP;
        }

        #region Player Player { get; } (player)
        private Player player;

        /// <summary>
        /// Gets the player's situation after the win.
        /// </summary>
        public Player Player
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.player;
            }
        }
        #endregion

        #region int GainedXP { get; } (gainedXP)
        private int gainedXP;

        /// <summary>
        /// Gets the amount of XP gained by winning.
        /// </summary>
        public int GainedXP
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.gainedXP;
            }
        }
        #endregion

        #region int GoldWon { get; } (goldWon)
        private int goldWon;

        /// <summary>
        /// Gets the amount of gold gained by winning.
        /// </summary>
        public int GoldWon
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.goldWon;
            }
        }
        #endregion
    }
}
